﻿<UserControl x:Class="FIFP.Report.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:local="clr-namespace:FIFP.Report.Report"
    xmlns:vm="clr-namespace:FIFP.Report.ViewModel"
    d:DesignHeight="1028" d:DesignWidth="1920">

    <UserControl.DataContext>
        <vm:ReportViewModel></vm:ReportViewModel>
    </UserControl.DataContext>
    <Grid x:Name="LayoutRoot" Background="#2a2f36" ShowGridLines="False">        
        <Viewbox Stretch="Fill">
            <Grid Height="1028" Width="1920" Margin="10">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.5*" />
                    <ColumnDefinition Width="0.5*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Grid Margin="0" Grid.ColumnSpan="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.3*"></ColumnDefinition>
                        <ColumnDefinition Width="0.4*"></ColumnDefinition>
                        <ColumnDefinition Width="0.3*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding ReportHeaderName}" Foreground="Yellow" FontSize="18" FontWeight="Bold"  Grid.Column="1" Margin="0,5"/>
                    <StackPanel Orientation="Horizontal" Margin="0,2,33,0" Canvas.ZIndex="3000" HorizontalAlignment="Right" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Selected Year: " Foreground="White" FontFamily="Calibri" FontSize="20" VerticalAlignment="Top" Margin="0,2,0,0"/>
                        <ComboBox x:Name="cmbYear" Tag="ec" ItemsSource="{Binding YearList}" SelectedItem="{Binding SelectedYear,Mode=TwoWay}" VerticalAlignment="Top" Style="{StaticResource ComboBoxStyleRightDropArrow}" Width="85" Height="30" ItemContainerStyle="{StaticResource ComboBoxItemStyle}" >
                            <i:Interaction.Triggers>
                                <i:EventTrigger  EventName="SelectionChanged">
                                    <i:InvokeCommandAction Command="{Binding YearSelectionCommand}" CommandParameter="{Binding ElementName=cmbYear}"  />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </ComboBox>
                    </StackPanel>
                </Grid>
                
                <!--<TextBlock Text="{Binding ReportHeaderName}" Foreground="Yellow" FontSize="18" FontWeight="Bold"  Grid.ColumnSpan="2" Margin="0,5"/>-->
                <local:ReservoirCapacity x:Name="reservoirCapacity" Grid.Row="1" Grid.Column="0"></local:ReservoirCapacity>
                <local:EffectiveCapacity x:Name="effectiveCapacity" Grid.Row="1" Grid.Column="1"></local:EffectiveCapacity>
                <local:LossByMonth x:Name="lossByMonth" Grid.Row="2" Grid.Column="1"></local:LossByMonth>
                <local:LossesByDivision x:Name="lossByDivision" Grid.Row="2" Grid.Column="0"></local:LossesByDivision>

            </Grid>
        </Viewbox>
    </Grid>
</UserControl>
